﻿ 
using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application;

    /// <summary>
    /// 从机通讯基础输入参数
    /// </summary>
    public class DeviceRelSlaveBaseInput
    {
        /// <summary>
        /// 从机模板Id
        /// </summary>
        public virtual long DeviceSlaveTemplateId { get; set; }
        
        /// <summary>
        /// 设备id
        /// </summary>
        public virtual long DeviceInfoId { get; set; }
        
        /// <summary>
        /// 串口序号
        /// </summary>
        public virtual int ComIdx { get; set; }
        
        /// <summary>
        /// 从机地址
        /// </summary>
        public virtual int SlaveAddr { get; set; }
        
        /// <summary>
        /// 从机IP
        /// </summary>
        public virtual string SlaveIp { get; set; }
        
        /// <summary>
        /// 从机端口
        /// </summary>
        public virtual int SlavePort { get; set; }
        
        /// <summary>
        /// 创建者部门Id
        /// </summary>
        public virtual long? CreateOrgId { get; set; }
        
        /// <summary>
        /// 创建者部门名称
        /// </summary>
        public virtual string? CreateOrgName { get; set; }
        
        /// <summary>
        /// 创建时间
        /// </summary>
        public virtual DateTime? CreateTime { get; set; }
        
        /// <summary>
        /// 更新时间
        /// </summary>
        public virtual DateTime? UpdateTime { get; set; }
        
        /// <summary>
        /// 创建者Id
        /// </summary>
        public virtual long? CreateUserId { get; set; }
        
        /// <summary>
        /// 创建者姓名
        /// </summary>
        public virtual string? CreateUserName { get; set; }
        
        /// <summary>
        /// 修改者Id
        /// </summary>
        public virtual long? UpdateUserId { get; set; }
        
        /// <summary>
        /// 修改者姓名
        /// </summary>
        public virtual string? UpdateUserName { get; set; }
        
        /// <summary>
        /// 软删除
        /// </summary>
        public virtual bool IsDelete { get; set; }
        
    }

    /// <summary>
    /// 从机通讯分页查询输入参数
    /// </summary>
    public class PageDeviceRelSlaveInput : BasePageInput
    {
        /// <summary>
        /// 关键字查询
        /// </summary>
        public string? SearchKey { get; set; }

        /// <summary>
        /// 从机模板Id
        /// </summary>
        public long? DeviceSlaveTemplateId { get; set; }
        
        /// <summary>
        /// 设备id
        /// </summary>
        public long? DeviceInfoId { get; set; }
        
        /// <summary>
        /// 串口序号
        /// </summary>
        public int? ComIdx { get; set; }
        
        /// <summary>
        /// 从机地址
        /// </summary>
        public int? SlaveAddr { get; set; }
        
        /// <summary>
        /// 从机IP
        /// </summary>
        public string? SlaveIp { get; set; }
        
        /// <summary>
        /// 从机端口
        /// </summary>
        public int? SlavePort { get; set; }
        
    }

    /// <summary>
    /// 从机通讯增加输入参数
    /// </summary>
    public class AddDeviceRelSlaveInput : DeviceRelSlaveBaseInput
    {
        /// <summary>
        /// 从机模板Id
        /// </summary>
        [Required(ErrorMessage = "从机模板Id不能为空")]
        public override long DeviceSlaveTemplateId { get; set; }
        
        /// <summary>
        /// 设备id
        /// </summary>
        [Required(ErrorMessage = "设备id不能为空")]
        public override long DeviceInfoId { get; set; }
        
        /// <summary>
        /// 串口序号
        /// </summary>
        [Required(ErrorMessage = "串口序号不能为空")]
        public override int ComIdx { get; set; }
        
        /// <summary>
        /// 从机地址
        /// </summary>
        [Required(ErrorMessage = "从机地址不能为空")]
        public override int SlaveAddr { get; set; }
        
        /// <summary>
        /// 从机IP
        /// </summary>
        [Required(ErrorMessage = "从机IP不能为空")]
        public override string SlaveIp { get; set; }
        
        /// <summary>
        /// 从机端口
        /// </summary>
        [Required(ErrorMessage = "从机端口不能为空")]
        public override int SlavePort { get; set; }
        
        /// <summary>
        /// 软删除
        /// </summary>
        [Required(ErrorMessage = "软删除不能为空")]
        public override bool IsDelete { get; set; }
        
    }

    /// <summary>
    /// 从机通讯删除输入参数
    /// </summary>
    public class DeleteDeviceRelSlaveInput : BaseIdInput
    {
    }

    /// <summary>
    /// 从机通讯更新输入参数
    /// </summary>
    public class UpdateDeviceRelSlaveInput : DeviceRelSlaveBaseInput
    {
        /// <summary>
        /// 主键Id
        /// </summary>
        [Required(ErrorMessage = "主键Id不能为空")]
        public long Id { get; set; }
        
    }

    /// <summary>
    /// 从机通讯主键查询输入参数
    /// </summary>
    public class QueryByIdDeviceRelSlaveInput : DeleteDeviceRelSlaveInput
    {

    }
